﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Account/NewAccountMasterPage.Master"
    AutoEventWireup="true" EnableEventValidation="false" CodeBehind="Messages.aspx.cs"
    Inherits="AteneoLibri.Account.Messages" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Conversazione relativa alla vendita/acquisto di
        <div>
        <asp:Label ID="lblBookTitle" runat="server"></asp:Label>
        </div>
    </h2>
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:DataList ID="dlMessages" runat="server" AlternatingItemStyle-BackColor="#CCCCCC"
                Width="95%" BackColor="#FFFFFF" DataKeyField="IdMessage" RepeatDirection="Vertical"
                RepeatColumns="1" CellPadding="10" EnableViewState="false">
                <HeaderTemplate>
                </HeaderTemplate>
                <ItemTemplate>
                    <div>
                        <div class="bold" style="padding-bottom: 10px;">
                            Messaggio di
                            <asp:Label ID="lblMessageAuthor" runat="server" Text='<%# Eval("Author") %>'></asp:Label>
                        </div>
                        <div>
                            <asp:Label ID="lblTextMessage" runat="server" Text='<%# Eval("TextMessage") %>'></asp:Label>
                            <div style="text-align: right;">
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("Date") %>'></asp:Label>
                            </div>
                        </div>
                    </div>
                </ItemTemplate>
                <SeparatorTemplate>
                    <hr />
                </SeparatorTemplate>
                <FooterTemplate>
                </FooterTemplate>
            </asp:DataList>
            <asp:Panel runat="server" ID="pnlResponseMessage">
                <asp:Label ID="Label3" runat="server" Text="Invia un messaggio"></asp:Label>
                <br />
                <asp:TextBox runat="server" ID="txtResponseMessage" Width="92%" TextMode="MultiLine"
                    Rows="10"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvTextMessage" ControlToValidate="txtResponseMessage"
                        runat="server" ErrorMessage="* inserire il testo del messaggio" CssClass="failureNotification" ValidationGroup="vgTextMessage" Display="Dynamic"></asp:RequiredFieldValidator>
                <br />
                <div style="text-align: center; padding-top: 10px;">
                    <asp:Button runat="server" ID="btnSendMessage" CssClass="StandardButton" Text="Invia messaggio" OnClick="btnSendMessage_Click" ValidationGroup="vgTextMessage" />&nbsp;&nbsp;
                    <asp:Button runat="server" ID="btnClear" CssClass="StandardButton" Text="Cancella testo" OnClick="btnClear_Click" />
                </div>
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSendMessage" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            Refresh in corso ...
        </ProgressTemplate>
    </asp:UpdateProgress>
    
    <asp:Panel ID="pnlSoldTo" runat="server">        
        <div style="text-align: center; padding-top: 30px;">
            <div>
            Se hai concluso la trattativa puoi impostare il libro a venduto. Impostando il libro a venduto notificherai a tutti i possibili acquirenti che hai venduto questo libro.
            </div>
            <asp:ImageButton ID="btnSoldBook" runat="server" CssClass="metroButton" AlternateText="Setta lo stato del libro a venduto"
                ImageUrl="~/Images/buttons/SoldBookButton.Check.194x100.png" OnClick="btnSoldBook_Click" />
        </div>
    </asp:Panel>
    <!-- PANNELLI ERROR, WARNING, SUCCESS -->
    <asp:Panel runat="server" ID="pnlWarning" Visible="false">
        <table>
            <tr>
                <td>
                    <asp:Image ID="imgWarning" runat="server" ImageUrl="~/Images/warning.png" />
                </td>
                <td style="vertical-align: middle; padding-left: 20px;">
                    <asp:Label ID="lblWarning" runat="server" CssClass="failureNotification"></asp:Label>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel runat="server" ID="pnlSuccess" Visible="false">
        <table>
            <tr>
                <td>
                    <asp:Image ID="imgSuccess" runat="server" ImageUrl="~/Images/icon-success.png" />
                </td>
                <td style="vertical-align: middle; padding-left: 20px;">
                    <asp:Label ID="lblSuccess" runat="server" CssClass="failureNotification"></asp:Label>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel runat="server" ID="pnlError" Visible="false">
        <table>
            <tr>
                <td>
                    <asp:Image ID="imgError" runat="server" ImageUrl="~/Images/icon-denied.png" />
                </td>
                <td style="vertical-align: middle; padding-left: 20px;">
                    <asp:Label ID="lblError" runat="server" CssClass="failureNotification"></asp:Label>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
